Skip to content

Fix Tags table scroll staying disabled after backgrounding - #973

Closed
mvanhorn wants to merge 1 commit into
bryceco:masterfrom
mvanhorn:fix/867-restore-tags-scroll
Closed

Fix Tags table scroll staying disabled after backgrounding#973
mvanhorn wants to merge 1 commit into
bryceco:masterfrom
mvanhorn:fix/867-restore-tags-scroll

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What

Fixes the POI tag tables (Common Tags and All Tags) becoming permanently unscrollable, as reported when switching to another app mid-edit and coming back.

Why

When the autocomplete completion overlay appears on iOS 26+, AutocompleteTextField sets the enclosing table view's isScrollEnabled = false so the overlay owns scrolling. That flag is only restored to true in the overlay teardown branch of updateCompletionTableView().

If the app resigns active (for example switching to Safari) while the overlay is showing, the field can lose its editing state without the teardown path ever running, so the Tags table is left stuck at isScrollEnabled = false and never scrolls again. That matches the reported repro of switching to Safari and back.

Change

  • Dismiss the completion overlay on UIApplication.willResignActiveNotification (registered alongside the existing keyboard observers, removed by the existing deinit), so scrolling is restored before the app backgrounds. The handler is guarded on filteredCompletions being non-empty, so fields without an active overlay do nothing and inactive tables are not disturbed when the app switcher or control center is opened.
  • Defensively re-enable the enclosing table view's scrolling in textFieldDidEndEditing as a belt-and-suspenders restore.

The fix is confined to AutocompleteTextField.swift, the only place that disables the parent table's scrolling.

Fixes #867

The POI Common Tags and All Tags tables could become permanently
unscrollable. When the autocomplete completion overlay appears on
iOS 26+, AutocompleteTextField disables the enclosing table view's
scrolling so the overlay owns it, restoring it only when the overlay
is torn down. If the app resigned active (e.g. switching to Safari)
while the overlay was showing, the teardown path never ran and the
Tags table was left with isScrollEnabled = false.

Dismiss the completion overlay on UIApplication.willResignActive so
scrolling is restored before backgrounding, and defensively re-enable
the enclosing table view's scrolling when editing ends.

Fixes bryceco#867
@mvanhorn
mvanhorn force-pushed the fix/867-restore-tags-scroll branch from 410120a to f757d04 Compare July 27, 2026 13:04
@mvanhorn

Copy link
Copy Markdown
Contributor Author

Rebased onto master -- f757d04.

Worth noting what moved. This branch patched textFieldDidEndEditing(_:), and master has since replaced those delegate methods with the target-action editingEnded(). So the defensive scroll restore now lives in editingEnded(), and the realDelegate?.textFieldDidEndEditing?(...) forwarding the branch added is gone -- that whole forwarding layer went away upstream, so re-adding it would have reintroduced it. The willResignActive observer and appWillResignActive are unchanged.

Separately, the test job isn't reaching any tests. It exits 70 during setup:

xcodebuild: error: Unable to find a device matching the provided destination specifier

That's the runner's simulator list not matching the workflow's destination, which usually means the macOS image rotated its installed simulators. Nothing here touches build or test configuration -- it's one file. I didn't touch the destination specifier since that's a repo-wide CI change, but happy to send it separately if you want it.

I can't run the iOS test suite locally, so this is swiftc -parse clean and rebase-verified only.

@bryceco

bryceco commented Jul 27, 2026

Copy link
Copy Markdown
Owner

You can ignore the fact that GitHub's CI tests fail, since they fail for reasons unrelated to project code.

bryceco added a commit that referenced this pull request Jul 27, 2026
Similar fix to @mvanhorn PR #973, implemented a bit differently
@bryceco

bryceco commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Fixed upstream in a slightly different way. Thanks!

@bryceco bryceco closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can’t scroll on the Tags page

2 participants